package com.itstu;

import com.itstu.netty.CoordinationNettyServer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

import javax.annotation.Resource;

/**
 * @author lz
 *  启动类
 */
@SpringBootApplication
@MapperScan("com.itstu.mapper")
@EnableAspectJAutoProxy
public class NettyConversionApplication implements CommandLineRunner {

    @Resource
    private CoordinationNettyServer coordinationNettyServer;

    /**
     * 启动方法
     */
    public static void main(String[] args) {
        SpringApplication.run(NettyConversionApplication.class, args);
    }

    /**
     * 启动时执行netty服务
     */
    @Override
    public void run(String... args) throws Exception {
        coordinationNettyServer.start();
    }
}
